<%@page import="com.opensymphony.xwork2.ActionContext"%>
<%@page import="org.w3c.dom.Document"%>
<%@page import="utils.XMLUtils"%>
<%@page import="xmlasm.sync.FilePathHolder"%>
<%@page import="xmlasm.bo.UserBO"%>
<%@page import="xmlasm.dto.User"%>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>Fish Reader - Thay thế mới cho Google Reader</title>
        <link rel="shortcut icon" href="img/feed-icon-28x28.png"/>
        <link href="css/app.css" rel="stylesheet"/>
    </head>

    <body onload="">
        <!-- Begin cai div ve dau trang -->
        <div id="top-page"></div>
        <%
                    if (session.getAttribute("USER") != null) {
                        User user = new User();
                        user = (User) session.getAttribute("USER");
                        if (UserBO.checkIsActive(user.getUserId()) == false) {
        %>
        <jsp:forward page="login.html"/>
        <%                    //RequestDispatcher rd = request.getRequestDispatcher("login.html");
                            //rd.forward(request, response);
                        }
                    }

        %>
        <!-- End div ve dau trang -->
        <c:if test="${empty USER}">
            <div id="header">
                <div class="container">
                    <div id="top-logo" class="float-left logo"></div>
                    <div id="navigation" class="float-right">
                        <ul>
                            <li><a href="index.action">Trang chủ</a></li>
                            <li><a class="registerNav" href="beginRegister.action">Đăng ký</a></li>
                            <li><a href="doLogin.action">Đăng nhập</a></li>
                        </ul>
                    </div>
                </div>
            </div>
        </c:if>
        <c:if test="${not empty USER}">
            <div id="header">
                <div class="container">
                    <div id="top-logo" class="float-left logo"></div>
                    <div id="navigation" class="float-right">
                        <ul>
                            <li><a class="homeNav" href="index.action">Trang chủ</a></li>
                            <li><a class="listNav" href="getFeedList.action">Danh sách feed</a></li>
                            <li><a class="editNav" href="editUser.action">${USER.fullName}</a></li>
                            <li><a class="feedbackNav" href="doFeedback.action">Góp ý</a></li>
                            <li><a href="logout.action">Đăng xuất</a></li>
                            <c:if test="${ USER.isAdmin}">
                                <li><a href="admin/adminHome.action">Admin</a></li>
                            </c:if>
                        </ul>
                    </div>
                </div>
            </div>
        </c:if>
